home *** CD-ROM | disk | FTP | other *** search
/ IRIX 6.5 Applications 2001 May / SGI IRIX 6.5 Applications 2001 May.iso / dev / insight_dev.idb / usr / include / make / commonbookrules.z / commonbookrules
Encoding:
Text File  |  2001-04-05  |  18.2 KB  |  570 lines

  1. #    Common rules for making SGML and HTML 
  2.  
  3. # BOOK_FILES is defined when it's an SGML book...
  4. #if defined(BOOK_FILES)
  5. SOURCES     = ${BOOK_FILES}
  6. TMP_TARGETS = ${BOOK_FILES:.doc=.sgm}
  7. TARGETS     = ${TMP_TARGETS:.fm=.sgm}
  8.  
  9. TMP_XXX_FILES = ${BOOK_FILES:S/.doc$/.sgm/g}
  10. XXX_FILES   = ${TMP_XXX_FILES:S/.fm$/.sgm/g}
  11. SGM_FILES   = ${XXX_FILES:S/.mif$/.sgm/g}
  12. VER_FILES   = ${SGM_FILES:S/.sgm$/.ver/g}
  13. ERR_FILES   = ${SGM_FILES:S/.sgm$/.err/g}
  14. DIRT_FILES  = ${SGM_FILES:S/.sgm$/.ctl/g} booklist.txt
  15.  
  16. TMP_MIF_FILES = ${BOOK_FILES:S/.doc$/.mif/g}
  17. MIF_FILES   = ${TMP_MIF_FILES:S/.fm$/.mif/g}
  18. #if ${BOOK_FILES:S/[     ]*/ /g} == "${MIF_FILES}"
  19. MIF_FILES   =
  20. #endif
  21. #endif
  22.  
  23. SHELF       != echo ${BOOKSHELF} | sed "s/.*\///"
  24.  
  25. LANGUAGE     != echo ${BOOK_LANG} | sed "s/_.*//" | sed "s/C/en/"
  26. MKBOOK_FLAGS = -language ${LANGUAGE}
  27.  
  28.  
  29. # all the definitions based on the specific DTD in the Makefile
  30. #if ${DTD} == "SGIDOC"
  31. REAL_DTD = ${SGIDOC_LIB}/dtd/default.dtd
  32. STYLES_DIR = ${SGIDOC_LIB}/styles
  33. SRCH_TAGS = TITLE:Titles;CAPTION,FIGURE:Figure Captions:1;CAPTION,TABLE:Table Captions:1;TABLE:Tables;CODE EXAMPLE:Code Examples
  34. HIDDEN ?= FALSE
  35.  
  36. #elif ${DTD} == "XHELP"
  37. REAL_DTD = ${XHELP_LIB}/dtd/XHELP.dtd
  38. STYLES_DIR = ${XHELP_LIB}/styles
  39. SRCH_TAGS = HELPLABEL,HELPTOPIC TITLE:Titles:1;TITLE,FIGURE:Figure Captions:1;EXAMPLE:Code Examples
  40. HIDDEN ?= TRUE
  41.  
  42. #elif ${DTD} == "DOCBOOK"
  43. REAL_DTD = ${DOCBOOK_LIB}/dtd/docbook.dtd
  44. STYLES_DIR = ${DOCBOOK_LIB}/styles
  45. SRCH_TAGS = TITLE:Titles;TITLE,FIGURE:Figure Captions:1;TITLE,TABLE:Table Captions:1;TABLE:Tables;EXAMPLE:Code Examples
  46. HIDDEN ?= FALSE
  47.  
  48. #elif ${DTD} == "CRAYDOC" || ${DTD} == "CRAYDOCBK"
  49. REAL_DTD = ${CRAYDOCBK_LIB}/dtd/CRAYDOCBK.dtd
  50. STYLES_DIR = ${CRAYDOCBK_LIB}/styles
  51. SRCH_TAGS = TITLE:Titles;TITLE,FIGURE:Figure Captions:1;TITLE,TABLE:Table Captions:1;TABLE:Tables;EXAMPLE:Examples;PROCEDURE:Procedures
  52. HIDDEN ?= FALSE
  53.  
  54. #else
  55. REAL_DTD = ../../${BOOK}.dtd
  56. STYLES_DIR = ../../styles
  57. #endif
  58.  
  59.  
  60. .SUFFIXES: .sgm .doc .fm .mif .ver .err
  61.  
  62. ## Rule for converting Frame files to MIF files
  63. ## if not SGIDOC DTD then don't use the conditional file
  64. .fm.mif .doc.mif:
  65. #if ${DTD} == "SGIDOC"
  66.     @TMPFILE=${TMPDIR}/${@:.mif=.$$.tmp}; \
  67.     TMP_CONDITION_FILE=${TMPDIR}/${@:.mif=.$$.cond.tmp}; \
  68.     echo "system \"cp ${CONDITION_FILE} $${TMP_CONDITION_FILE}\"" > $${TMPFILE}; \
  69.     echo "system \"chmod 664 $${TMP_CONDITION_FILE}\"" >> $${TMPFILE}; \
  70.     echo "Open $<" >> $${TMPFILE}; \
  71.     echo "Open $${TMP_CONDITION_FILE}" >> $${TMPFILE}; \
  72.     echo "UseFormatsFrom x $< $${TMP_CONDITION_FILE}" >> $${TMPFILE}; \
  73.     echo "SaveAs m $< $*.mif.tmp" >> $${TMPFILE}; \
  74.     echo "Quit $<" >> $${TMPFILE}; \
  75.     ${FMBATCH} $${TMPFILE}; \
  76.     echo ${MIFHEADER} > $*.mif; \
  77.     echo "#SGI=$*" >> $*.mif; \
  78.     cat $*.mif.tmp >> $*.mif; \
  79.     ${RM} -f $${TMPFILE} $*.mif.tmp $${TMP_CONDITION_FILE}
  80. #else
  81.     @TMPFILE=${TMPDIR}/${@:.mif=.$$.tmp}; \
  82.     echo "Open $<" > $${TMPFILE}; \
  83.     echo "SaveAs m $< $*.mif" >> $${TMPFILE}; \
  84.     echo "Quit $<" >> $${TMPFILE}; \
  85.     ${FMBATCH} $${TMPFILE}; \
  86.     ${RM} -f $${TMPFILE}
  87. #endif
  88.  
  89. # Rule for converting MIF files to SGML files
  90. # this also builds CGM figures if necessary
  91. .mif.sgm:
  92. #if ${DTD} == "SGIDOC"
  93. #if defined(BOOK_LANG)
  94. #if ${BOOK_LANG} == "ja_JP.EUC"
  95.     @${MIF2SGML} ${CGM_NOTRAS} -i ${INTL_MAP_DIR}/${BOOK_LANG}.intl_map $<
  96. #else
  97.     @${MIF2SGML} ${CGM_NOTRAS} -i ${INTL_MAP_DIR}/${BOOK_LANG}.intl_map $<
  98. #endif
  99. #else
  100.     @${MIF2SGML} ${CGM_NOTRAS} $<
  101. #endif
  102. #elif ${DTD} == "XHELP"
  103.     @echo "Frame to XHELP not supported at this time"; exit 1
  104. #elif ${DTD} == "DOCBOOK"
  105.     @echo "Generic Frame to DocBook requires Passage's translator"; exit 1
  106. #else
  107.     ${OTHER_TRANSLATOR} $<
  108. #endif
  109.     -@ mkdir -p online 1> /dev/null 2>&1
  110.     @if (`grep 'RASTERCONVERT' $*.sgm>/dev/null`) then \
  111.       echo "Creating CGM images..."; \
  112.       (CLHOME=${CLHOME}; MIFTOCGM_IP=${MIFTOCGM_IP}; \
  113.         export CLHOME MIFTOCGM_IP; \
  114.         ${MIFTOCGM} ${CGM_VERBOSE} -c ${CLHOME}/data/kt.map -i $< -o online/$*.cgm ); \
  115.       TIFF_FILES=`grep '<!-- RASTERCONVERT:' $*.sgm |sed -e 's/.*<!-- RASTERCONVERT: \(.*\) -->.*/\1/'` ; \
  116.       for i in $${TIFF_FILES} ; do \
  117.             echo "Converting" $$i "to GIF"; \
  118.         N_GIF=`echo $$i|sed 's/\.cgm$$/-1.gif/'|sed 's/\.cgm\([0-9][0-9]*\)/-\1\.gif/'`; \
  119.             (CLHOME=${CLHOME}; export CLHOME; \
  120.             ${CLTRANS} online/$$i online/$$i.out -of tiff \
  121.             ${CGM_VERBOSE} \
  122.             -oo "${CGM_VERBOSE} -t palette -comp lzw -dpi 285"); \
  123.             ${TIFFTOPNM} online/$$i.out | ${PNMSCALE} .37 | ${PNMCROP} | \
  124.         ${PNMMARGIN} -white 10 | \
  125.         ${PPMQUANT} 256 > ${TMPDIR}/$$i.ppm; \
  126.         /usr/sbin/fromppm ${TMPDIR}/$$i.ppm ${TMPDIR}/$$i.rgb; \
  127.         /usr/sbin/hipass3 ${TMPDIR}/$$i.rgb ${TMPDIR}/$$i.rgb_sh .5; \
  128.         ${TOGIF} ${TMPDIR}/$$i.rgb_sh online/$${N_GIF} ; \
  129.             /bin/rm online/$$i.out online/$$i ${TMPDIR}/$$i.ppm ${TMPDIR}/$$i.rgb ${TMPDIR}/$$i.rgb_sh; \
  130.       done; \
  131.     fi
  132.  
  133. # Rule for generating SGML Validation report files for SGML files
  134. .sgm.ver:
  135.     @echo "SGML Validation not supported at this time"; exit 1
  136.  
  137. # Rule for generating UNKNOWN errors report files for SGML files
  138. .sgm.err:
  139.     -@${EGREP} '<\!\-\- ERROR|<\!\-\- WARNING|<UNKNOWN.ERROR' $< > $*.err
  140.  
  141. EndPart:
  142.     @echo "</PART>" > EndPart
  143.  
  144. EndPart.err:
  145.     @touch EndPart.err
  146.  
  147. # Build the master SGML file which is concatenation of all individual
  148. # SGML files with TITLE at the front and <SGIDOC> tag around either
  149. # <MANUAL> or <SUPPORT> depending on the book type.
  150.  
  151. ${MASTER_SGM}: ${SGM_FILES}
  152.     @echo " ======== Building master sgml file ======== "
  153.     @${RM} -f ${MASTER_SGM}
  154.     @if [ "${SGM_FILES}" = "" ] ; then \
  155.       echo "error: No SGML files to process"; \
  156.       exit 1; \
  157.     fi 
  158. #if ${DTD} == "SGIDOC"
  159.     @${RM} -f ${TMP_MASTER_SGM}
  160.     @${RM} -f ${INDEXFILE}
  161.     @for i in ${SGM_FILES}; do cat $$i >> ${TMP_MASTER_SGM}; done
  162. #if ${BOOK_LANG} != "ja_JP.EUC"
  163.     @cat ${TMP_MASTER_SGM} | ${INDEXGEN} -s -o ${INDEXFILE}
  164. #endif
  165.     @if [ "${DOC_TYPE}" = "" ] ; then \
  166.       echo "<SGIDOC LANG=\"${BOOK_LANG}\"><MANUAL>" > ${MASTER_SGM}; \
  167.     else \
  168.       echo "<SGIDOC LANG=\"${BOOK_LANG}\"><${DOC_TYPE}>" > ${MASTER_SGM}; \
  169.     fi 
  170. #endif
  171.     @for i in ${SGM_FILES}; do cat $$i >> ${MASTER_SGM}; done
  172. #if ${DTD} == "SGIDOC"
  173. #if ${BOOK_LANG} != "ja_JP.EUC"
  174.     @cat ${INDEXFILE} >> ${MASTER_SGM}
  175. #endif
  176.     @if [ "${DOC_TYPE}" = "" ] ; then \
  177.       echo "</MANUAL></SGIDOC>" >> ${MASTER_SGM} ; \
  178.     else \
  179.       echo "</${DOC_TYPE}></SGIDOC>" >> ${MASTER_SGM} ; \
  180.     fi
  181.     @${RM} -f ${TMP_MASTER_SGM}
  182. #endif
  183.  
  184. ${BOOKDIR}/${BOOK}.sgm: ${MASTER_SGM}
  185.     -@mkdir -p ${BOOKDIR} 1> /dev/null 2>&1
  186.     @${RM} -f ${BOOKDIR}/${BOOK}.sgm
  187.     @${CP} ${MASTER_SGM} ${BOOKDIR}/${BOOK}.sgm
  188.  
  189. # Branch for ruled for making a book out of 'compiled' sgm files, or HTML
  190. #if ${DTD} != "HTML"
  191. default book help xhelp: mk_book figures
  192.  
  193. #else
  194. default book help xhelp:
  195.     @echo "operation not supported with HTML books"
  196.  
  197. clobber clean rmtargets fluff tags:
  198.     @echo "operation not supported with HTML books"
  199.  
  200. #if defined(RAWIDB)
  201. install: booklist.txt
  202. #    Generate booklist.txt idb
  203.     $(INSTALL) -m 644 -f ${BOOKSHELF}/${BOOKDIR} \
  204.         -idb '${BOOKSUBSYSTEM} exitop("(chroot \$$rbase /usr/sbin/insightAdmin -avfn ${BOOK_LANG} ${BOOKSHELF}>>\$$rbase/var/share/Insight/install.insight.log)2>>\$$rbase/var/share/Insight/install.insight.log")' \
  205.         booklist.txt
  206. #       Generate helpmap idbs 
  207.     if [ -d help ] ; then \
  208.         (cd help; \
  209.         if [ "${BOOK_LANG}" = "C" ] ; then \
  210.             $(INSTALL) -m 644 -idb $(HELPSUBSYSTEM) \
  211.              -f ${HELPDIR}/help *.helpmap; \
  212.         else \
  213.         $(INSTALL) -m 644 -idb $(HELPSUBSYSTEM) \
  214.             -f ${HELPDIR}/help/${BOOK_LANG} *.helpmap; \
  215.         fi; \
  216.         cd ..); \
  217.     fi
  218. #       Generate book directory idb
  219.     $(INSTALL) -u root -g sys  -m 755 \
  220.         -idb '${BOOKSUBSYSTEM} removeop("if [ -r $$rbase/usr/sbin/insightAdmin ]; then chroot \$$rbase /usr/sbin/insightAdmin -avfn ${BOOK_LANG} ${BOOKSHELF}>>\$$rbase/var/share/Insight/install.insight.log 2>&1; fi")' \
  221.         -dir ${BOOKSHELF}/${BOOKDIR}
  222. #       Generate subdirectory idbs, if any
  223.     for d in $(BOOK_DIRS); do \
  224.         if [ "$$d" != "." ]; then \
  225.         $(INSTALL) -m 755 -idb $(BOOKSUBSYSTEM) \
  226.             -dir ${BOOKSHELF}/${BOOKDIR}/$$d; \
  227.         fi; \
  228.     done
  229. #       Generate files idbs 
  230.     for d in $(BOOK_DIRS); do \
  231.         if [ "$$d" = "." ]; then \
  232.         for ext in ${HTML_EXTS}; do \
  233.             for f in *.$$ext; do \
  234.                 if [ -f $$f ]; then \
  235.                     $(INSTALL) -m 644 -idb $(BOOKSUBSYSTEM) \
  236.                     -f ${BOOKSHELF}/${BOOKDIR} $$f; \
  237.                 fi; \
  238.             done; \
  239.         done; \
  240.         else \
  241.         for ext in ${HTML_EXTS}; do \
  242.             for f in $$d/*.$$ext; do \
  243.                 if [ -f $$f ]; then \
  244.                      $(INSTALL) -m 644 -idb $(BOOKSUBSYSTEM) \
  245.                     -f ${BOOKSHELF}/${BOOKDIR} $$f; \
  246.                 fi; \
  247.             done; \
  248.         done; \
  249.         fi; \
  250.     done
  251. #else
  252. install:
  253.     @echo "warning: 'install' not supported if RAWIDB not defined"
  254.  
  255. #endif
  256. #endif
  257.  
  258. # notice that any tdr files less than 42 in length are being removed
  259. .ORDER: prep_book ${BOOKDIR}/ebt/${BOOK}.edr
  260. pub_book mk_book: prep_book ${BOOKDIR}/ebt/${BOOK}.edr
  261.  
  262. ${BOOKDIR}/ebt/${BOOK}.edr: ${MASTER_SGM}
  263. #if ${DTD} == "XHELP"
  264.     @(${BOOK_ENV}; ${MKHELP} -col . ${BOOK})
  265. #else
  266. #if ${DTD} == "SGIDOC"
  267. #if exists(${MKSGIDOC})
  268.     @(${BOOK_ENV}; ${MKSGIDOC} ${MKBOOK_FLAGS} -col `pwd` ${BOOK})
  269. #else
  270.     @(${BOOK_ENV}; ${MKBOOK} ${MKBOOK_FLAGS} -col `pwd` ${BOOK})
  271. #endif
  272. #else
  273.     @(${BOOK_ENV}; ${MKBOOK} ${MKBOOK_FLAGS} -col `pwd` ${BOOK})
  274. #endif
  275. #endif
  276.     -@for f in `${LS} -1 ${BOOKDIR}/ebt/*.tdr`; do \
  277.         (${BOOK_ENV}; ${TDRCHK} 42 $$f); done
  278.  
  279.  
  280. booklist.txt: Makefile
  281. #if ${DTD} != "OTHER"
  282.     @if [ -f booklist.txt ] ; then \
  283.         ${MV} booklist.txt booklist.txt.old; \
  284.     fi
  285.     @echo '<BOOK NAME="${TITLE}" ALIAS="'${FULL_TITLE}'" TYPE="Adi3xDocument" SGITYPE="${BOOK_ICON}" SGIHIDE="${HIDDEN}" SGIVERSION="${VERSION}" SGIBKADDR="${FEEDBACK_ADDR}" \c' > booklist.txt
  286.     @if [ ${SORT_ORDER} != "" ] ; then \
  287.         echo 'SGISORT="${SORT_ORDER}" \c' >> booklist.txt; \
  288.     fi
  289.     @if [ ${SGICONTAINER} != "" ] ; then \
  290.         echo 'SGICONTAINER=${SGICONTAINER} \c' >> booklist.txt; \
  291.     fi
  292.     @echo 'SGISRCHRES="${HIDDEN}" SGISRCHTAGS="$(SRCH_TAGS)" SGIGROUP="${DTD}">' >> booklist.txt
  293. #endif
  294.  
  295. prep_book: ${BOOKDIR}/${BOOK}.sgm booklist.txt
  296.     -@mkdir -p ${BOOKDIR}/ebt 1> /dev/null 2>&1
  297.     -@mkdir -p ${BOOKDIR}/index 1> /dev/null 2>&1
  298.     @if [ ! -f ${BOOKDIR}/${BOOK}.dtd ] ; then \
  299.         if [ -f ${BOOK}.dtd ] ; then \
  300.         ln -s ../../${BOOK}.dtd ${BOOKDIR}/${BOOK}.dtd; \
  301.         else \
  302.         ln -s ${REAL_DTD} ${BOOKDIR}/${BOOK}.dtd; \
  303.         fi \
  304.     fi
  305.     @if [ ! -d  ${BOOKDIR}/styles ] ; then \
  306.         if [ -d styles ] ; then \
  307.         ln -s ../../styles ${BOOKDIR}/styles; \
  308.         else \
  309.         ln -s ${STYLES_DIR} ${BOOKDIR}/styles; \
  310.         fi \
  311.     fi
  312.     @if [ ! -d  ${BOOKDIR}/entities ] ; then \
  313.         if [ -d entities ] ; then \
  314.         ln -s ../../entities ${BOOKDIR}/entities; \
  315.         else \
  316.         ln -s ${ENTITIES_DIR} ${BOOKDIR}/entities; \
  317.         fi \
  318.     fi
  319.     @if [ ! -f ${BOOKDIR}/${BOOK}.ctl ] ; then \
  320.         if [ -f ${BOOK}.ctl ] ; then \
  321.         ln -s ../../${BOOK}.ctl ${BOOKDIR}/${BOOK}.ctl; \
  322.         fi \
  323.     fi
  324.  
  325. book.ver ${BOOK}.ver: ${MASTER_SGM}
  326.     @${RM} -f ${BOOK}.ver
  327.     @echo "SGML Validation not supported"; exit 1
  328.  
  329. verify: ${MASTER_SGM}
  330.     -@(EBTRC=${EBTRC}; TOOLROOT=${ITOOLROOT}; export EBTRC TOOLROOT; \
  331.       if [ ! -d entities ] ; then \
  332.         if [ -d ${ENTITIES_DIR} ] ; then \
  333.         ln -s ${ENTITIES_DIR} entities; \
  334.         REMOVE_ENTS=TRUE; export REMOVE_ENTS; \
  335.         else \
  336.         REMOVE_ENTS=FALSE; export REMOVE_ENTS; \
  337.         fi \
  338.     fi; \
  339.     ${SGMLRVW} -quiet -verifyMore -dtd ${REAL_DTD} -f ${MASTER_SGM} ; \
  340.     if [ $$REMOVE_ENTS = "TRUE" ] ; then \
  341.         ${RM} -f entities ; \
  342.     fi)
  343.  
  344. book.err ${BOOK}.err: ${ERR_FILES}
  345.     @${RM} -f ${BOOK}.err
  346.     @for i in ${ERR_FILES}; do \
  347.       echo "=== $$i Translation Error/Warning report ===" >> ${BOOK}.err; \
  348.       cat $$i >> ${BOOK}.err; \
  349.       echo "" >> ${BOOK}.err; \
  350.     done
  351.  
  352. book.full ${BOOK}.full: ${ERR_FILES} ${MASTER_SGM} book
  353.     @echo " ======== Building master report file ======== "
  354.     @${RM} -f ${BOOK}.full
  355.     @for i in ${SGM_FILES}; do \
  356.       base=`basename $$i .sgm`; \
  357.       if [ -f $$base.err ] ; then \
  358.           echo "=== $$base.err Translation Error/Warning report ===" >> ${BOOK}.full; \
  359.           cat $$base.err >> ${BOOK}.full; \
  360.       fi; \
  361.       echo "" >> ${BOOK}.full; \
  362.     done
  363. #if exists(/usr/sbin/perl)
  364. #if defined(SGI_QA)
  365.     @echo "=== ${BOOK} Internal SGI Doc report ===" >> ${BOOK}.full
  366.     -@${SGIBOOK_QA} >> ${BOOK}.full
  367. #endif
  368.     @echo "=== ${BOOK} Link QA report file ===" >> ${BOOK}.full
  369.     -@(TOOLROOT=${ITOOLROOT}; export TOOLROOT; \
  370.       ${XREF} ${MASTER_SGM} >> ${BOOK}.full)
  371.     @echo "" >> ${BOOK}.full
  372.     @echo "=== ${BOOK} Glossary QA report file ===" >> ${BOOK}.full
  373.     -@${GLOSSQA} ${MASTER_SGM} >> ${BOOK}.full
  374.     @echo "" >> ${BOOK}.full
  375. #else
  376.     @echo "WARNING: Link QA and Glossary QA reports require /usr/sbin/perl...skipped" >> ${BOOK}.full
  377.     @echo "" >> ${BOOK}.full
  378. #endif
  379. #if defined(VALIDATE)
  380.     @echo "=== ${BOOK} EBT validation report file ===" >> ${BOOK}.full
  381.     -@(EBTRC=${EBTRC}; TOOLROOT=${ITOOLROOT}; export EBTRC TOOLROOT; \
  382.        if [ ! -d entities ] ; then \
  383.         if [ -d ${ENTITIES_DIR} ] ; then \
  384.         ln -s ${ENTITIES_DIR} entities; \
  385.         REMOVE_ENTS=TRUE; \
  386.         else \
  387.         REMOVE_ENTS=FALSE; export REMOVE_ENTS; \
  388.         fi \
  389.     fi ; \
  390.     ${SGMLRVW} -quiet -verifyMore -dtd ${REAL_DTD} -f ${MASTER_SGM} >> ${BOOK}.full 2>&1 ; \
  391.     if [ $$REMOVE_ENTS = "TRUE" ] ; then \
  392.         ${RM} -f entities; \
  393.     fi)
  394.     @echo "" >> ${BOOK}.full
  395. #endif
  396.  
  397.  
  398. .ORDER: _online copy_figures
  399. figures: _online copy_figures
  400.  
  401. localfigrules: Makefile
  402.     @smake -J 1 -r -f Makefile XXX=$$$$ rules
  403.  
  404. _online: localfigrules
  405.     @if [ -d orig ] ; then \
  406.       (mkdir -p online 1> /dev/null 2>&1; \
  407.       TOOLROOT=${ITOOLROOT}; export TOOLROOT; \
  408.       make -r -f Makefile COMMONPREPRULES=${COMMONFIGRULES} online_figs) ;\
  409.     fi
  410.  
  411. copy_figures: ${SGM_FILES} ${MASTER_SGM}
  412.     -@mkdir -p ${BOOKDIR}/figures 1> /dev/null 2>&1
  413.     -@if [ -d online ] ; then \
  414.       (for i in ${BOOKDIR}/figures/*; do \
  415.         ${RM} -f $$i ; done ) ; \
  416.     fi
  417. #if defined(MISC_FILES)
  418. #if ! empty(MISC_FILES)
  419.     @(cd orig; ${CP} ${MISC_FILES} ../${BOOKDIR}/figures ; cd ..)
  420. #endif
  421. #endif
  422. #if ${DTD} == "SGIDOC"
  423.     @if [ -d online ] ; then \
  424.       ${CLEAN_CGMS} ${MASTER_SGM} online ; \
  425.       (for i in `${COPY_SGIDOC_FIGS} ${MASTER_SGM}` ; do \
  426.           ${CP} online/$$i ${BOOKDIR}/figures/$$i ; \
  427.       done) ; \
  428.     fi
  429. #else
  430.     @if [ -d online ] ; then \
  431.     (cd online; for i in *; do \
  432.         ${CP} $$i ../${BOOKDIR}/figures/$$i ; \
  433.     done; cd ..) ; \
  434.     fi
  435.  
  436. #endif
  437.     -@rmdir ${BOOKDIR}/figures 1> /dev/null 2>&1
  438.  
  439. _print print: localfigrules
  440.     -@mkdir -p print 1> /dev/null 2>&1
  441.     @make -r -f Makefile COMMONPREPRULES=${COMMONFIGRULES} print_figs
  442.  
  443. #if ${DTD} != "HTML"
  444. #if ! defined(RAWIDB)
  445. install::
  446.       @echo "warning: 'install' not supported if RAWIDB not defined"
  447. #else
  448. .ORDER: mk_book copy_figures common_install
  449. install:: mk_book copy_figures common_install
  450. #endif
  451. #endif
  452.  
  453. #if ! defined(RAWIDB)
  454. booksinstall::
  455.       @echo "warning: 'install' not supported if RAWIDB not defined"
  456. #else
  457. .ORDER: mk_book figures copy_figures common_install
  458. booksinstall:: mk_book figures copy_figures common_install
  459. #endif
  460.  
  461. common_install:
  462.     $(INSTALL) -u root -g sys  -m 755 \
  463.         -idb '${BOOKSUBSYSTEM} removeop("if [ -r $$rbase/usr/sbin/insightAdmin ]; then chroot \$$rbase /usr/sbin/insightAdmin -avfn ${BOOK_LANG} ${BOOKSHELF}>>\$$rbase/var/share/Insight/install.insight.log 2>&1; fi")' \
  464.         -dir ${BOOKSHELF}/${BOOKDIR}
  465.     $(INSTALL) -u root -g sys  -m 755 -idb ${BOOKSUBSYSTEM} \
  466.         -dir ${BOOKSHELF}/${BOOKDIR}/ebt
  467.     $(INSTALL) -m 644 -f ${BOOKSHELF} -idb \
  468.         ${BOOKSUBSYSTEM} ${BOOKDIR}/ebt/*
  469.     $(INSTALL) -u root -g sys  -m 755 -idb ${BOOKSUBSYSTEM} \
  470.         -dir ${BOOKSHELF}/${BOOKDIR}/index
  471.     $(INSTALL) -m 644 -f ${BOOKSHELF} -idb \
  472.         ${BOOKSUBSYSTEM} ${BOOKDIR}/index/*
  473.     $(INSTALL) -u root -g sys  -m 755 -idb ${BOOKSUBSYSTEM} \
  474.         -dir ${BOOKSHELF}/${BOOKDIR}/styles
  475.     $(INSTALL) -m 644 -f ${BOOKSHELF} -idb \
  476.         ${BOOKSUBSYSTEM} ${BOOKDIR}/styles/*
  477.     if [ -d online ] ; then \
  478.         $(INSTALL) -u root -g sys  -m 755 -idb ${BOOKSUBSYSTEM} \
  479.             -dir ${BOOKSHELF}/${BOOKDIR}/figures ; \
  480.         (for i in ${BOOKDIR}/figures/*; do \
  481.             $(INSTALL) -m 644 -f ${BOOKSHELF} -idb \
  482.             ${BOOKSUBSYSTEM} $$i ; done ) \
  483.     ; fi
  484.     if [ -d help ] ; then \
  485.         if [ "${BOOK_LANG}" = "C" ] ; then \
  486.              $(INSTALL) -m 644 -f ${HELPDIR} -idb ${HELPSUBSYSTEM}  \
  487.             `${COPY_HELPMAPS} ${MASTER_SGM} help` ; \
  488.         else \
  489.               (cd help; \
  490.             $(INSTALL) -m 644 -f ${HELPDIR}/help/${BOOK_LANG}\
  491.             -idb ${HELPSUBSYSTEM} \
  492.             `${COPY_HELPMAPS} ../${MASTER_SGM} .` ; \
  493.                cd ..) ; \
  494.         fi \
  495.     ; fi
  496.     $(INSTALL) -m 644 -f ${BOOKSHELF}/${BOOKDIR} \
  497.         -idb '${BOOKSUBSYSTEM} exitop("(chroot \$$rbase /usr/sbin/insightAdmin -avfn ${BOOK_LANG} ${BOOKSHELF}>>\$$rbase/var/share/Insight/install.insight.log)2>>\$$rbase/var/share/Insight/install.insight.log")' \
  498.         booklist.txt
  499. ### #if exists($(ROOT)/usr/include/make/commonindexdefs) 
  500. ### #    Generate wrd and html index files for SGML book
  501. ###     @echo "\tbuilding word list..."
  502. ###     (EBTRC=${EBTRC}; EBT_PLATFORM=${EBT_PLATFORM}; TOOLROOT=${ITOOLROOT}; \
  503. ###         LD_LIBRARY_PATH=${TOOLROOT}/usr/share/ebt/irix5m/lib:${LD_LIBRARY_PATH}; \
  504. ###          export EBTRC EBT_PLATFORM TOOLROOT LD_LIBRARY_PATH; \
  505. ###         ${DTL2SGFT} -b ${BOOK} -s `pwd` -u ${SHELF} -q ${INDEX_GRAN} \
  506. ###         -d ${TOOLROOT}/usr/share/ebt/data)
  507. ###     if test ! -d $(WORDDIR); then \
  508. ###         mkdir -p $(WORDDIR) \
  509. ###     ; fi
  510. ###     -mv ${BOOKDIR}/*.wrd $(WORDDIR)
  511. ###     $(INSTALL) -m 644 -f ${BOOKSHELF} -idb ${BOOKSUBSYSTEM} ${BOOKDIR}/*.html 
  512. ### #endif
  513.  
  514.  
  515. #if ${DTD} != "HTML"
  516. #if exists($(ROOT)/usr/include/make/commonindexdefs) 
  517. clean:: clean_book clean_reports sg_index_clean
  518. #else
  519. clean:: clean_book clean_reports
  520. #endif
  521.     ${RM} -rf $(DIRT)
  522.  
  523. clobber:: clean clean_figures clean_sgm
  524. clobber_all: clobber clean_print 
  525. #endif
  526.  
  527. # Remove the master sgml file and files in the 'books' sub directory.
  528. clean_book::
  529.     ${RM} -f ${MASTER_SGM} ${INDEXFILE} ${MIF_FILES}
  530.     ${RM} -rf ${BOOKDIR}/ebt ${BOOKDIR}/index ${BOOKDIR}/styles
  531.     ${RM} -rf ${BOOKDIR}/entities ${BOOKDIR}/figures
  532.     ${RM} -f ${BOOKDIR}/${BOOK}.dtd ${BOOKDIR}/${BOOK}.sgm ${BOOKDIR}/${BOOK}.ctl
  533.  
  534. # Remove the report files
  535. clean_reports::
  536.     ${RM} -f ${VER_FILES} ${ERR_FILES}
  537.     ${RM} -f ${BOOK}.err ${BOOK}.ver ${BOOK}.full
  538.  
  539. # Remove the generated figures
  540. clean_figures::
  541.     ${RM} -f online/* ${LOCALFIGRULES}
  542.  
  543. #if defined(BOOK_FILES)
  544. # Remove all sgml files - only if NONE of the sources are .sgm files
  545. #if ${BOOK_FILES:S/[     ]*/ /g} == "${BOOK_FILES:S/.sgm$/.skip/g}"
  546. clean_sgm::
  547.     ${RM} -f ${SGM_FILES}
  548. #else
  549. clean_sgm::
  550.  
  551. #endif
  552. #endif
  553.  
  554. clean_print::
  555.     ${RM} -f print/*
  556.  
  557. #if exists($(ROOT)/usr/include/make/commonindexdefs) 
  558. $(INDEXPREF)sg_index_clean:: 
  559.     -@/usr/bin/rm -f $(IDIRT)
  560. #if defined(SRC)
  561.     -@/usr/bin/rm -f $(WORDDIR)/$(IDIRT)
  562. #endif
  563. #endif
  564.  
  565.  
  566. # Remove any crufty files
  567. XDIRT = printFiles.* onlineFiles.* localFigs.* ${DIRT_FILES} ${BOOK}.sgml.tmp \
  568.     *.bak *.backup booklist.txt.old EndPart.err EndPart
  569.  
  570.